package service.impl;

import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import dao.UserDao;
import pojo.User;
import service.UserManager;

@Service(value="umi2")
public class UserManagerImpl2 implements UserManager {
	@Resource(name="udi")
	private UserDao ud;
	
	@Override
	public User addUser(User user) {
		user.setId(UUID.randomUUID().toString());
		ud.addUser(user);
		return user;
	}

	@Override
	public String deleteUser(String id) {
		ud.deleteUser(id);
		return id;
	}

	@Override
	public User updataUser(User user) {
		ud.updateUser(user);
		return user;
	}

	@Override
	public List<User> findAll() {

		return ud.findAllUsers();
	}

}
